package com.carkeeper.shop.check.dao;
import com.carkeeper.pojo.ServiceType;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
@Repository
public interface TypeMapper extends Mapper<ServiceType> {
    //parent_id=null的所有数据
    @Select("select * from tb_service_type where parent_id is null")
    public Page<ServiceType> findAllType();
    //parent_id!=null的所有数据
    @Select("select * from tb_service_type where parent_id is not null")
    public List<ServiceType> findAllTypeItem();
    //查询服务分类关联的子分类个数
    @Select("select count(*) from tb_service_type where parent_id = #{id}")
    public Integer findCountByTypeId(@Param("id") String id);

}
